<%@page import="java.util.Collections"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.syzg.base.login.model.LoginObject" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.syzg.base.merge.model.Module" %>
<%@ page import="com.syzg.common.config.SysProperties" %>
<!DOCTYPE html>
<!-- saved from url=(0057) -->
<%
	request.setAttribute("ctx", request.getContextPath());
	LoginObject loginObject = (LoginObject)session.getAttribute(SysProperties.LOGIN_OBJECT);
	String personName = loginObject.getPersonName();
	List<Module> moduleList = new ArrayList();
	
	List<Module> allModuleList = null;
	if(session.getAttribute(SysProperties.PERSON_MODULE_LIST) != null) {
		allModuleList = (List<Module>)session.getAttribute(SysProperties.PERSON_MODULE_LIST);
	}
	Map<String,Map<String,Module>> map2 = new HashMap<String,Map<String,Module>>();
	for(Module module: allModuleList) {
		if(module.getLeafFlag() == 0){
			Map<String,Module> map = map2.get(module.getId());
			if(map == null){
				map = new HashMap<String,Module>();
				map2.put(module.getId(),map);
			}
			map.put(module.getId(), module);
		} else {
			Map<String,Module> map = map2.get(module.getParentModule().getId());
			if(map == null){
				map = new HashMap<String,Module>();
				map2.put(module.getId(),map);
			}
			map.put(module.getId(), module);
		}
	}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="${ctx}/AdminLTE2/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="${ctx}/AdminLTE2/plugins/jQuery/jQuery-2.2.0.min.js"></script>
<script src="${ctx}/AdminLTE2/bootstrap/js/bootstrap.js" type="text/javascript"></script>
<!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <style>
        html {
            -ms-text-size-adjust: 100%;
            -webkit-text-size-adjust: 100%;
        }

        body {
            font-family: 'Microsoft Yahei', '微软雅黑', '宋体', \5b8b\4f53, Tahoma, Arial, Helvetica, STHeiti;
            margin: 0;
        }

        .main-nav {
            margin-left: 1px;
        }

            .main-nav.nav-tabs.nav-stacked > li {
            }

                .main-nav.nav-tabs.nav-stacked > li > a {
                    padding: 10px 8px;
                    font-size: 12px;
                    font-weight: 600;
                    color: #4A515B;
                    background: #E9E9E9;
                    background: -moz-linear-gradient(top, #FAFAFA 0%, #E9E9E9 100%);
                    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FAFAFA), color-stop(100%,#E9E9E9));
                    background: -webkit-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%);
                    background: -o-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%);
                    background: -ms-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%);
                    background: linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%);
                    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9');
                    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9')";
                    border: 1px solid #D5D5D5;
                    border-radius: 4px;
                }

                    .main-nav.nav-tabs.nav-stacked > li > a > span {
                        color: #4A515B;
                    }

                .main-nav.nav-tabs.nav-stacked > li.active > a, #main-nav.nav-tabs.nav-stacked > li > a:hover {
                    color: #FFF;
                    background: #3C4049;
                    background: -moz-linear-gradient(top, #4A515B 0%, #3C4049 100%);
                    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4A515B), color-stop(100%,#3C4049));
                    background: -webkit-linear-gradient(top, #4A515B 0%,#3C4049 100%);
                    background: -o-linear-gradient(top, #4A515B 0%,#3C4049 100%);
                    background: -ms-linear-gradient(top, #4A515B 0%,#3C4049 100%);
                    background: linear-gradient(top, #4A515B 0%,#3C4049 100%);
                    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4A515B', endColorstr='#3C4049');
                    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#4A515B', endColorstr='#3C4049')";
                    border-color: #2B2E33;
                }

                    #main-nav.nav-tabs.nav-stacked > li.active > a, #main-nav.nav-tabs.nav-stacked > li > a:hover > span {
                        color: #FFF;
                    }

            .main-nav.nav-tabs.nav-stacked > li {
                margin-bottom: 4px;
            }

        .nav-header.collapsed > span.glyphicon-chevron-toggle:before {
            content: "\e114";
        }

        .nav-header > span.glyphicon-chevron-toggle:before {
            content: "\e113";
        }

        footer.duomi-page-footer {
            background-color: white;
        }

            footer.duomi-page-footer .beta-message {
                color: #a4a4a4;
            }

                footer.duomi-page-footer .beta-message a {
                    color: #53a2e4;
                }

            footer.duomi-page-footer .list-inline a, footer.authenticated-footer .list-inline li {
                color: #a4a4a4;
                padding-bottom: 30px;
            }




        footer.duomi-page-footer {
            background-color: white;
        }

            footer.duomi-page-footer .beta-message {
                color: #a4a4a4;
            }

                footer.duomi-page-footer .beta-message a {
                    color: #53a2e4;
                }

            footer.duomi-page-footer .list-inline a, footer.authenticated-footer .list-inline li {
                color: #a4a4a4;
                padding-bottom: 30px;
            }

        /*********************************************自定义部分*********************************************/
        .secondmenu a {
            font-size: 12px;
            color: #4A515B;
            text-align: center;
            border-radius: 4px;
        }

        .secondmenu > li > a:hover {
            background-color: #6f7782;
            border-color: #428bca;
            color: #fff;
        }

        .secondmenu li.active {
            background-color: #6f7782;
            border-color: #428bca;
            border-radius: 4px;
        }

            .secondmenu li.active > a {
                color: #ffffff;
            }

        .navbar-static-top {
            background-color: #212121;
            margin-bottom: 5px;
        }

        .navbar-brand {
            background: url('http://static-res.ruyo.net/ruyo_net_w_32.png') no-repeat 10px 8px;
            display: inline-block;
            vertical-align: middle;
            padding-left: 50px;
            color: #fff;
        }

            .navbar-brand:hover {
                color: #fff;
            }


        .collapse.glyphicon-chevron-toggle, .glyphicon-chevron-toggle:before {
            content: "\e113";
        }

        .collapsed.glyphicon-chevron-toggle:before {
            content: "\e114";
        }
    </style>
</head>

<body>
    <div class="navbar navbar-duomi navbar-static-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="http://ruyo-net-demo.qiniudn.com/Admin/index.html" id="logo">南网传媒图片库管理系统
                </a>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <ul id="main-nav" class="main-nav nav nav-tabs nav-stacked" style="">
                    <li>
                        <a href="#">
                            <i class="glyphicon glyphicon-th-large"></i>
                           	 首页
                        </a>
                    </li>
                    <%
                    	for(String key : map2.keySet()){
                    		Map<String,Module> map = map2.get(key);
                    		Module moduleM = map.get(key);
                    %>
                    		<li>
			                    <a href="#<%=moduleM.getCode()%>" class="nav-header collapsed" data-toggle="collapse">
			                        <i class="glyphicon glyphicon-cog"></i>
			                           	<%=moduleM.getName()%>
			                        <span class="pull-right glyphicon glyphicon-chevron-toggle"></span>
			                    </a>
			                    <ul id="<%=moduleM.getCode()%>" class="nav nav-list secondmenu collapse" style="height: 0px;">
                    <%
                    		for(String key_ : map.keySet()){
                    			if(key == key_)continue;
                    			Module module = map.get(key_);
                    %>
                    			<li><a href="javascript:;" onclick="gotoUrl('<%=module.getHref()%>');"><i class="glyphicon glyphicon-th-list"></i><%=module.getName()%></a></li>
                    <%			
                    		}
                    %>
                    			</ul>
                    		</li>
                    <%	}
                    %>
                </ul>
            </div>
            <div class="col-md-10" id="content">
				<iframe id="fr" src="${ctx }/base/jsp/welcome.jsp" frameBorder=0 scrolling=yes width="100%" height="100%" onload="Javascript:SetWinHeight(this)">111</iframe>
            </div>
        </div>
    </div>
    <script type="text/javascript">
    	function gotoUrl(url){
    		$("#fr",parent.document.body).attr("src","/csgnews" + url);
    	}
    	function SetWinHeight(){
    		var mainheight = window.screen.availHeight-122;
    		//alert(mainheight);
    		//alert(window.screen.height);
    		//alert($("#fr",parent.document.body).height());
    		$("#fr",parent.document.body).height(mainheight);
    	}
   	    /*$(function () {
   	        window.setInterval("reinitIframe()", 2000);
   	    });*/
    </script>
</body></html>